package com.cloud.freeflow.api.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.freeflow.api.entity.ProcTransDef;
import com.cloud.freeflow.api.service.ProcTransDefService;
import com.cloud.freeflow.common.result.Quokka;

@RestController
@RequestMapping("freeflow/api/proctransdef")
public class ProcTransDefController {
	
	@Autowired
	private ProcTransDefService procTransService;
	
	@RequestMapping("create")
	public Quokka createProcTrans(@RequestBody ProcTransDef trans){
		return new Quokka(true, procTransService.createProcTrans(trans));
	}
	
	@RequestMapping("list")
	public Quokka listProcTrans(ProcTransDef trans){
		return new Quokka(true, procTransService.listProcTrans(trans));
	}
	
	@RequestMapping("delete")
	public Quokka deleteTrans(long id){
		return new Quokka(true, procTransService.delete(id));
	}
	
	@RequestMapping("load")
	public Quokka loadTranset(Long id){
		return new Quokka(true, procTransService.load(id));
	}
	
	@RequestMapping("update")
	public Quokka updateTranSet(@RequestBody ProcTransDef trans){
		return new Quokka(true, procTransService.updateTrans(trans));
	}
}
